/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.rooms;

import bllInterface.Account;
import bllInterface.iFriendListener;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.ArrayList;
import javax.swing.event.ListDataListener;
import model.ClientFriendListModel;

/**
 *
 * @author Mrkupi
 */
public class FriendListenerImpl extends UnicastRemoteObject implements iFriendListener
{
    private ClientFriendListModel model = new ClientFriendListModel();
    
    public FriendListenerImpl() throws RemoteException
    {
    }
    
    public void addListListener(ListDataListener listener) throws RemoteException
    {
        model.addListDataListener(listener);
    }

    @Override
    public void add(Account acc) throws RemoteException 
    {
        model.addAccount(acc);
    }

    @Override
    public void remove(Account acc) throws RemoteException 
    {
        model.removeElement(acc);
    }

    @Override
    public void addAll(ArrayList<Account> accs) throws RemoteException 
    {
        for (Account acc : accs)
        {
            model.addAccount(acc);
        }
    }
    
}